package ucl.cs.bank.server;
/**
 * Bank Server Class.
 * @author  K. Bryson.
 * @version 1.0
 */

import java.rmi.registry.LocateRegistry;
import java.rmi.registry.Registry;
import java.rmi.server.UnicastRemoteObject;

import ucl.cs.bank.common.UCLBank;

public class UCLBankServer { 
	public UCLBankServer() { 

		try {
			UCLBankImpl bank = new UCLBankImpl();
			UCLBank stub = (UCLBank) UnicastRemoteObject.exportObject(bank, 0);

			// Bind the UCLBank's stub in the RMI Registry
			// with the name 'UCLBankServer' that clients can lookup.
			Registry registry = LocateRegistry.getRegistry();
			registry.rebind("UCLBankServer", stub);

		} catch (Exception e) {
			System.out.println("Trouble: " + e);
		}

		System.out.println("Server Started.");
	}
	public static void main(String args[]) {
		new UCLBankServer();
	}
}

